
import os
import gdal
import numpy as np
from matplotlib import pyplot as plt

HH_file_path='D:\KJ_code\GF3_MYN_WAV_020086_E107.2_N27.6_20200603_L1A_AHV_L10004843087\GF3_MYN_WAV_020086_E107.2_N27.6_20200603_L1A_HH_L10004843087.tiff'

HH_file=gdal.Open(HH_file_path)
im_width = HH_file.RasterXSize #栅格矩阵的列数
im_height = HH_file.RasterYSize #栅格矩阵的行数
HH_bands= HH_file.ReadAsArray(0,0,im_width,im_height).astype(np.float32)

HH_bands_pow=np.sqrt(np.power(HH_bands[0,:,:],2)+np.power(HH_bands[1,:,:],2))

plt.imshow(HH_bands_pow)
print(HH_file.RasterCount)